package com.automannn.websocketmqtt.websocketNodeA.amqp.sender;

import com.automannn.websoketmqtt.common.amqp.DirectGlobalValue;
import com.automannn.websoketmqtt.common.message.WsMessage;
import com.automannn.websoketmqtt.common.message.WsMessageQueueProperties;
import org.springframework.amqp.rabbit.core.RabbitTemplate;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Component;

/**
 * @author chenkh
 * @time 2020/10/13 15:37
 */
@Component
public class WsMulticastSender {
    @Autowired
    private RabbitTemplate rabbitTemplate;

    public void send(WsMessage wsMessage){
        if (wsMessage!=null){
            rabbitTemplate.convertAndSend(WsMessageQueueProperties.WS_EXCHANGE, null,wsMessage);
        }
    }
}
